//
//  ToolMethod.swift
//  SwiftMusicPlayer
//
//  Created by 顾佳槟 on 2018/3/7.
//  Copyright © 2018年 lancoo. All rights reserved.
//

import UIKit

struct ToolMethod {
    static func CreateImage(color:UIColor!) -> UIImage{
        let rect:CGRect = CGRect.init(x: 0, y: 0, width: 1.0, height: 1.0)
        UIGraphicsBeginImageContext(rect.size)
        let context:CGContext = UIGraphicsGetCurrentContext()!
        context.setFillColor(color.cgColor)
        context.fill(rect)
        let image:UIImage = UIGraphicsGetImageFromCurrentImageContext()!
        
        UIGraphicsEndImageContext()
        
        return image   
    }
}
